/**
 * Alipay.com Inc.
 * Copyright (c) 2004-2014 All Rights Reserved.
 */
package cn.yunyichina.provider.pay.alipay.executor;

import cn.yunyichina.provider.iface.entity.pay.PaymentSettingResponse;
import cn.yunyichina.provider.pay.alipay.utils.AlipayMsgBuildUtil;

import java.util.Map;

/**
 * 默认执行器(该执行器仅发送ack响应)
 * 
 * @author baoxing.gbx
 * @version $Id: InAlipayDefaultExecutor.java, v 0.1 Jul 30, 2014 10:22:11 AM baoxing.gbx Exp $
 */
public class InAlipayDefaultExecutor implements ActionExecutor {

    /** 业务参数 */
    private Map<String, String> bizContent;

    private PaymentSettingResponse paymentSetting;

    public InAlipayDefaultExecutor(Map<String, String> bizContent ,PaymentSettingResponse paymentSetting) {
        this.bizContent = bizContent;
        this.paymentSetting = paymentSetting;
    }

    public InAlipayDefaultExecutor() {
        super();
    }


    @Override
    public String execute() throws Exception {

        //取得发起请求的支付宝账号id
        final String fromUserId = bizContent.get("FromUserId");

        return AlipayMsgBuildUtil.buildBaseAckMsg(fromUserId , paymentSetting.getPayAppId());
    }
}
